package com.mxchip.livestar.utils;

import android.util.Log;

public class MyLog {
    private static final String TAG = "MyLog";
    public static boolean isShow = true;

    //音频相关
    public static int AUDIO_SEND_MODEL = 0x0001;
    public static int AUDIO_RECEIVE_MODEL = 0x0002;

    public static int AUDIO_SEND_CTRL_MODEL = 0x0004;
    public static int SEND_AUDIO_PACKET_MODEL = 0x008;

    public static int CUSTOM_AUDIO_SOURCE_MODEL = 0x0010;
    public static int AUDIO_PLAYER_MODEL = 0x0020;


    //视频相关
    public static int VIDEO_SEND_MODEL = 0x0040;
    public static int VIDEO_RECEIVE_MODEL = 0x0080;
    public static int CUSTOM_VIDEO_SOURCE_MODEL = 0x0100;

    public static int WIFI_CAMERA_SEND_MODEL = 0x0200;
    public static int LOCAL_CAMERA_SEND_MODEL = 0x0400;
    public static int NATIVE_CAMERA_SEND_MODEL = 0x0800;
    public static int HDMI_CAMERA_SEND_MODEL = 0x20000000;

    public static int VIDEO_RENDER_MODEL = 0x1000;
    public static int DECODER_HANDLER_MODEL = 0x10000000;


    //Activity
    public static int CALL_ACTIVITY_A_MODEL = 0x2000;
    public static int WELCOME_ACTIVITY_MODEL = 0x4000;


    //Fragment
    public static int CALL_CONTROL_FRAGMENT_MODEL = 0x8000;
    public static int ADMIN_MUTE_DIALOG_FRAGMENT_MODEL = 0x10000;
    public static int VIDEO_FRAGMENT_MODEL = 0x20000;
    public static int DIAL_FRAGMENT_MODEL = 0x40000;

    //viewmodel
    public static int SCREEN_VIEW_MODEL_MODEL = 0x80000;
    public static int AV_DEVICE_MODEL = 0x100000;
    public static int STREAMING_AV_DEVICE_MODEL = 0x200000;
    public static int SHARE_CONTENT_MODEL = 0x400000;
    public static int SETTING_VIEW_MODEL = 0x40000000;
    //tools
    public static int RETROFIT_FACTORY_MODEL = 0x800000;
    public static int RX_BUS_MODEL = 0x1000000;
    public static int UTILS_MODEL = 0x2000000;

    //信令
    public static int SIGNALLING_MODEL = 0x4000000;

    //设备相关
    public static int USB_DISK_RECEIVER_MODEL = 0x8000000;


    private static int mask =
            //音频相关
//            AUDIO_SEND_MODEL
//                    | AUDIO_RECEIVE_MODEL
//                    | AUDIO_SEND_CTRL_MODEL
//                    | SEND_AUDIO_PACKET_MODEL
//                    | CUSTOM_AUDIO_SOURCE_MODEL
//                    | AUDIO_PLAYER_MODEL|
                    //视频相关
                     VIDEO_SEND_MODEL|
                     VIDEO_RECEIVE_MODEL
                    | CUSTOM_VIDEO_SOURCE_MODEL
                    | WIFI_CAMERA_SEND_MODEL
//                    | LOCAL_CAMERA_SEND_MODEL
//                    | NATIVE_CAMERA_SEND_MODEL|
//                    HDMI_CAMERA_SEND_MODEL|
//                     VIDEO_RENDER_MODEL
//                    | DECODER_HANDLER_MODEL
//                    //Activity
//                             |CALL_ACTIVITY_A_MODEL
//                    | WELCOME_ACTIVITY_MODEL|
//                    //Fragment
//                     CALL_CONTROL_FRAGMENT_MODEL
//                    | ADMIN_MUTE_DIALOG_FRAGMENT_MODEL
//                    | VIDEO_FRAGMENT_MODEL
//                    | DIAL_FRAGMENT_MODEL
//                    //viewmodel
//                    | SCREEN_VIEW_MODEL_MODEL
                    |
                    AV_DEVICE_MODEL|
//                    | STREAMING_AV_DEVICE_MODEL
                    SHARE_CONTENT_MODEL |
                             SETTING_VIEW_MODEL |
//                    //tools
//                    | RETROFIT_FACTORY_MODEL
//                    | RX_BUS_MODEL
//                    | UTILS_MODEL |
//                    //信令
                    SIGNALLING_MODEL
//                    //设备相关
//                    | USB_DISK_RECEIVER_MODEL
            ;


    public static void logTime(int FLAG, String args) {
        if (isShow) {
            if ((mask & FLAG) != 0)
                Log.d("logTime-"+FLAG, args);
        }
    }

    public static void logE(int FLAG, String args) {
        if (isShow) {
//            if ((mask & FLAG) != 0)
                Log.e("errorMsg-"+FLAG, args);
        }
    }

    public static void logD(int FLAG, String args) {


        if (isShow) {
            if ((mask & FLAG) != 0)
                Log.d("logMsg-"+FLAG, args);
        }
    }

    public static void logDebug(int FLAG, String args) {
        if (isShow) {
            if ((mask & FLAG) != 0)
                Log.d("logDebug", args);
        }
    }

    public static void logTemple(String args) {
        Log.d("logMsg", args);
    }
}
